/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MenuPadrao.java
 *
 * Created on 22/11/2009, 23:27:52
 */

package redesinterf;

import Dados.BuscaArquivos;
import Dados.DownloadArquivos;
import Dados.UploadArquivos;
import JPaneis.MenuDownloads;
import JPaneis.MenuInicial;
import JPaneis.MenuUploads;
import JPaneis.MenuBuscaArquivo;
import java.awt.BorderLayout;
import javax.swing.JPanel;

/**
 *
 * @author Leo
 */
public class MenuPadrao extends javax.swing.JFrame {

    private MenuBuscaArquivo menuBuscaArquivo;
    private MenuDownloads menuDownloads;
    private MenuUploads menuUploads;
    private MenuInicial menuInicial;
    private JPanel atual = new JPanel();
    private BuscaArquivos[] buscaArquivos;
    private DownloadArquivos[] downloadArquivos;
    private UploadArquivos[] uploadArquivos;
    
    /** Creates new form MenuPadrao */
    public MenuPadrao() {
        initComponents();
        menuBuscaArquivo = new MenuBuscaArquivo(this, buscaArquivos);
        menuDownloads = new MenuDownloads(this, downloadArquivos);
        menuUploads = new MenuUploads(this, uploadArquivos);
        menuInicial = new MenuInicial(this);
        buscaArquivos = new BuscaArquivos[30];
        downloadArquivos = new DownloadArquivos[15];
        uploadArquivos = new UploadArquivos[15];
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenu1.setText("Arquivo");

        jMenuItem1.setText("Sair");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Sobre");

        jMenuItem2.setText("Ajuda");
        jMenu2.add(jMenuItem2);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Downloads");

        jMenuItem3.setText("Procurar Arquivo");
        jMenu3.add(jMenuItem3);

        jMenuItem5.setText("Visualizar Downloads");
        jMenu3.add(jMenuItem5);

        jMenuBar1.add(jMenu3);

        jMenu4.setText("Uploads");

        jMenuItem4.setText("Visualizar Uploads");
        jMenu4.add(jMenuItem4);

        jMenuBar1.add(jMenu4);

        jMenu5.setText("Chat");
        jMenuBar1.add(jMenu5);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 729, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 419, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_jMenuItem1ActionPerformed

        public void trocaPanel2(JPanel novo) {

        atual.setVisible(false);
        this.add(novo,BorderLayout.CENTER);
        novo.setVisible(true);
        atual = novo;
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MenuPadrao().setVisible(true);
            }
        });
    }

    public MenuBuscaArquivo getMenuBuscaArquivo() {
        return menuBuscaArquivo;
    }

    public MenuDownloads getMenuDownloads() {
        return menuDownloads;
    }

    public MenuUploads getMenuUploads() {
        return menuUploads;
    }

    public MenuInicial getMenuInicial() {
        return menuInicial;
    }




    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    // End of variables declaration//GEN-END:variables

}
